package com.woniuxy01;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Scanner;

/**
 * @author 作者
 * @create 2025-07-29 15:47
 */
public class Test04 {

    public static void main(String[] args) {

        new Scanner(System.in).nextInt();
        try {
            Date date = stringToDate("2000-a1-1");
            System.out.println(date);
        } catch (ParseException e) {
            throw new RuntimeException(e);
//            System.out.println("处理异常");
        }
    }

    public static Date stringToDate(String str) throws ParseException {
        try {
            DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
            Date date = df.parse(str);
            return date;
        } catch (ParseException e) {
            System.out.println("处理异常，抛出异常，没有处理");
//            throw new RuntimeException(e);
            throw e;
        }
    }
}
